import request from '@/utils/request'

// 新建分类
export function categoryCreate(data) {
  return request({
    url: '/category/create',
    method: 'post',
    data
  })
}
// 分类列表
export function getCategoryList(params) {
  return request({
    url: '/category/list',
    method: 'get',
    params
  })
}

// 删除分类
export function categoryDelete(id) {
  return request({
    url: `/category/remove/${id} `,
    method: 'post'
  })
}

// 查询分类
export function findCategory(id) {
  return request({
    url: `/category/find/${id} `,
    method: 'get'
  })
}

// 修改分类
export function updateCategory(id, data) {
  return request({
    url: `/category/update/${id} `,
    method: 'post',
    data
  })
}

// 修改分类状态
export function editStatus(id, data) {
  return request({
    url: `/category/editStatus/${id} `,
    method: 'post',
    data
  })
}
